package com.atguigu.daijia.map.service;

import com.atguigu.daijia.model.form.map.OrderServiceLocationForm;
import com.atguigu.daijia.model.form.map.SearchNearByDriverForm;
import com.atguigu.daijia.model.form.map.UpdateDriverLocationForm;
import com.atguigu.daijia.model.form.map.UpdateOrderLocationForm;
import com.atguigu.daijia.model.vo.map.NearByDriverVo;
import com.atguigu.daijia.model.vo.map.OrderLocationVo;
import com.atguigu.daijia.model.vo.map.OrderServiceLastLocationVo;

import java.math.BigDecimal;
import java.util.List;

public interface LocationService {

    /**
     * 更新司机经纬度位置
     * @param updateDriverLocationForm
     * @return 是否更新成功
     */
    Boolean updateLocation(UpdateDriverLocationForm updateDriverLocationForm);

    /**
     * 删除司机经纬度坐标
     * @param driverId
     * @return
     */
    Boolean removeDriver(Long driverId);

    /**
     * 查询附近可以接单的司机集合
     * @param searchNearByDriverForm
     * @return
     */

    List<NearByDriverVo> searchNearByDriver(SearchNearByDriverForm searchNearByDriverForm);

    /**
     * 更新订单位置到缓存中
     * @param updateOrderLocationForm
     * @return
     */
    Boolean updateOrderLocationToCache(UpdateOrderLocationForm updateOrderLocationForm);

    /**
     * 获取缓存的司机当前位置信息
     * @param orderId
     * @return
     */
    OrderLocationVo getOrderLocation(Long orderId);

    Boolean saveOrderServiceLocation(List<OrderServiceLocationForm> orderLocationServiceFormList);

    /**
     * 获取当前订单的最后位置信息
     * @param orderId
     * @return
     */
    OrderServiceLastLocationVo getOrderServiceLastLocation(Long orderId);

    /**
     * 计算实际订单里程
     * @param orderId
     * @return
     */
    BigDecimal calculateOrderRealDistance(Long orderId);
}
